<?php $container_id = Util::createGUID();?>
<script type="text/javascript">

function updateList(){
	var xhrO = getXmlHttpRequest2();
	xhrO.open("POST","<?php print url_for('evenements/getList')?>",false);
	xhrO.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhrO.setRequestHeader('X_REQUESTED_WITH','XMLHttpRequest');
	xhrO.send("ownerclass=<?php echo get_class($self)?>&owner_id=<?php echo $self->id;?>"); 
	document.getElementById('<?php echo $container_id;?>').innerHTML = xhrO.responseText;
	$("a.fancy").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false,
		'titleShow'		: false
	});
}

function showErrMsg(errMsg){
	
}
</script>
<div id="<?php echo $container_id; ?>">
<?php 
	$objectDef = new objectDef('evenement');
	$q = $objectDef->getBaseQuery();
	$q->addWhere('a.ownerclass= ? ', get_class($self));
	$q->addWhere('a.owner_id='.$self->id);
	$q->addOrderBy('a.date desc');
	$q->addOrderBy('a.heure desc');
	$q->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY);
	$items =	$q->execute();
	include_partial('ajaxViewer/list', array('self'=>$self, 'className' => 'evenement', 'items'=>$items, 'objectDef'=>$objectDef, 'create'=>false)); ?>
	
	
</div>